package com.paul.test;
import java.io.File;
import java.io.IOException;

public class AddFile {
	public static void main(String[] args) throws Exception {
        File file = new File("C:\\myeclipse\\workspace\\ssh");
        new AddFile().addFile(file);;
	}
	public void addFile(File file) throws Exception{
		if(file.isDirectory()&&file.listFiles().length!=0){
			File[] filelist =  file.listFiles();
			for(File myFile : filelist){
				addFile(myFile);
			}
		}
		else if(file.isDirectory()&&file.listFiles().length==0){
			String path = file.getAbsolutePath();
			File newFile = new File(path+File.separator+"newEmptyFile.txt");
			if(!newFile.exists()){
				System.out.println(newFile.createNewFile()?"true":"false");
			}
		}
		
	}
}
